const multer = require('multer') // 1 引入multer
// const multerUpload = multer({dest:'public/upload'}) // 2. 实例化multer上传对象
const storage = multer.diskStorage({
	destination: 'public/upload',
	filename: function (req, file, cb) {
		cb(null, Date.now() + '.jpg')
	},
}) // 2. 实例化multer上传对象
const multerUpload = multer({ storage })

module.exports = multerUpload